

import request from '@/utils/request'

export function saveAcceptanceTask(data) {
  return request({
    url: '/api/am/task/save',
    method: 'post',
    data
  })
}

export function finishAcceptanceTask(data) {
  return request({
    url: '/api/am/task/finish',
    method: 'post',
    data
  })
}

export function handOverAcceptanceTask(data) {
  return request({
    url: '/api/am/task/hand_over',
    method: 'post',
    data
  })
}

/**
 * @description: 获取验收任务
 * @param {*}
 * @return {*}
 */

export function listAcceptanceTask(data) {
  return request({
    url: '/api/am/task/list',
    method: 'post',
    data
  })
}

export function pageAcceptanceTask(data) {
  return request({
    url: '/api/am/task/page',
    method: 'post',
    data
  })
}

export function pageAcceptanceTaskGoods(data) {
  return request({
    url: '/api/am/task/page_goods',
    method: 'post',
    data
  })
}

export function taskListPreOptions() {
  return request({
    url: '/api/am/task/list_pre_options',
    method: 'get'
  })
}

export function deleteAttachment(data) {
  return request({
    url: '/api/am/task/delete_attachment',
    method: 'post',
    data
  })
}

export function listTwoOptions1() {
  return [
    { key: false, value: '无' },
    { key: true, value: '有' }
  ]
}

export function listTwoOptions2() {
  return [
    { key: false, value: '异常' },
    { key: true, value: '正常' }
  ]
}

export function listTwoOptions3() {
  return [
    { key: 0, value: '破损' },
    { key: 1, value: '完好' }
  ]
}

/**
 * @description: 拆分
 * @param {*}
 * @return {*}
 */
export function splitAttachment(data) {
  return request({
    url: '/api/am/task/split',
    method: 'post',
    data
  })
}


/**
 * @description: 交付申请批号
 * @param {*}
 * @return {*}
 */
export function applyGoodsBathApplication(data) {
  return request({
    url: '/api/am/task/apply_goods_bath_application',
    method: 'post',
    data
  })
}